<template>
	<el-card>
		<!-- 搜索 -->
		<el-form :model="searchData" inline ref="searchFormRef" v-resize="searchResize">
			<el-form-item label="系统模块" prop="title">
				<el-input v-model="searchData.title" clearable placeholder=""></el-input>
			</el-form-item>
			<el-form-item>
				<el-button icon="el-icon-search" type="primary" size="small" @click="searchClick">搜索</el-button>
				<el-button icon="el-icon-refresh" size="small" @click="resetClick">重置</el-button>
			</el-form-item>
		</el-form>

		<!-- 表格 -->
		<ywTable ref="tableRef" :searchData="searchData" :tableProps="tableProps" api="sysOperateLogFindAllByPage">
			<el-table-column slot="table_oper" label="操作" fixed="right">
				<template v-slot="scope">
					<el-button type="text" icon="el-icon-delete" @click="deleteClick(scope.row)">删除</el-button>
				</template>
			</el-table-column>
		</ywTable>
	</el-card>
</template>

<script>
	export default {
		name: "sysOperateLog",
		components: {},
		data() {
			return {
				//表格数据
				searchData: {
					title: null,
				},
				tableProps: [{
						label: "操作人员",
						prop: "userNickName",
						width: 120
					},
					{
						label: "客户端",
						prop: "clientShow",
						width: 120
					},
					{
						label: "系统模块",
						prop: "title",
						width: 120
					},
					{
						label: "业务类型",
						prop: "businessType",
						width:120
					},
					{
						label: "请求方法",
						prop: "method",
						type: "longText"
					},
					{
						label: "操作地址",
						prop: "operIp",
						width:160
					},
					{
						label: "操作日期",
						prop: "createTime",
						width: 160
					},
					{
						label: "操作参数",
						prop: "requestParam",
						type: "json"
					},
					{
						label: "操作结果",
						prop: "requestResult",
						type: "yulan"
					},
					{
						label: "操作状态",
						prop: "stateShow",
					},
					{
						label: "状态描述",
						prop: "stateRemark",
						type: "yulan"
					}
				],
			};
		},
		mounted() {
			this.$nextTick(() => {
				this.searchClick()
			})
		},
		methods: {
			//设置表格高度
			searchResize(data) {
				this.$refs.tableRef.refreshSize(data)
			},
			//搜索按钮
			searchClick() {

				this.$refs.tableRef.shuaxin(this.searchData)
			},
			//重置按钮
			resetClick() {
				this.$refs.searchFormRef.resetFields();


				this.searchClick()
			},
			//删除
			deleteClick(row) {
				this.$common.msgBoxDel(() => {
					this.$api.sysOperateLogDelByIds(row.id).then(res => {
						this.searchClick();
					});
				})
			},
		},
	};
</script>

<style lang="scss" scoped>

</style>